﻿Imports System.Windows.Forms
Imports System.Deployment.Application

Public Class dlgOptions

    Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
        If rdbNoLog.Checked = True Then
            My.MySettings.Default.logOption = "off"
        ElseIf rdbPromptLog.Checked = True Then
            My.MySettings.Default.logOption = "prompt"
        ElseIf rdbAlwaysLog.Checked = True Then
            My.MySettings.Default.logOption = "on"
        End If

        My.MySettings.Default.folderOption = cbxFolder.Checked
        My.MySettings.Default.errLog = cbxErrorLog.Checked
        My.MySettings.Default.obfuscate = cbxObfuscate.Checked

        Me.DialogResult = System.Windows.Forms.DialogResult.OK
        Me.Close()
    End Sub

    Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Button.Click
        Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
        Me.Close()
    End Sub

    Private Sub dlgOptions_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Select Case My.MySettings.Default.logOption
            Case "off"
                rdbNoLog.Checked = True
            Case "prompt"
                rdbPromptLog.Checked = True
            Case "on"
                rdbAlwaysLog.Checked = True
        End Select

        lblStat.Text = ". . ."
        cbxObfuscate.Checked = My.MySettings.Default.obfuscate
        cbxFolder.Checked = My.MySettings.Default.folderOption
        cbxErrorLog.Checked = My.MySettings.Default.errLog
    End Sub

    Private Sub btnCheckNow_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCheckNow.Click
    End Sub
End Class
